//
//  HWCommonTest.m
//  嗨文
//
//  Created by 响当当 on 7/3/19.
//  Copyright © 2019 dongzheng. All rights reserved.
//

#import "HWCommonTest.h"
#import "dsbridge.h"
#import "TempViewController.h"
#import "HWIndexViewController.h"


@interface HWCommonTest()
{
    NSTimer * timer ;
    void(^hanlder)(id value,BOOL isComplete);
    int value;
}
@end

@implementation HWCommonTest

- (NSString *)fromBookShelf:(id  _Nonnull)args
{
    return @"1";
}

- ( void )openBook:(id  _Nonnull)args
{
    NSDictionary *dic = [NSDictionary dictionaryWithDictionary:args];
    NSNumber *nub = IFNULL(dic[@"chapterCoin"], [NSNumber new]);
    NSNumber *chapterID = IFNULL(dic[@"readingChpaterId"], [NSNumber new]);
    NSNumber *chapterFreeNum = IFNULL(dic[@"chapterFreeNum"], [NSNumber new]);
    //    HWBookReadViewController *vc = [[HWBookReadViewController alloc]init];
    TempViewController *vc = [[TempViewController alloc]init];
    vc.chapterCoin = [nub stringValue];
    vc.chapterId = [chapterID stringValue];
    vc.chapterFreeNum = [chapterFreeNum stringValue];
    vc.hidesBottomBarWhenPushed = YES;
    [[HWUtilties getCurrentVC].navigationController pushViewController:vc animated:YES];
}

- ( void )openMenu:(id  _Nonnull)args
{
    NSDictionary *dic = [NSDictionary dictionaryWithDictionary:args];
    NSNumber *nub = IFNULL(dic[@"bookId"], [NSNumber new]);
    HWIndexViewController *vc = [[HWIndexViewController alloc]init];
    vc.booID = [nub stringValue];
    vc.hidesBottomBarWhenPushed = YES;
    [[HWUtilties getCurrentVC].navigationController pushViewController:vc animated:YES];
}

@end
